package com.liyao.windowtest4.pojo;

import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import lombok.Data;

/**
 * @program: windowtest4
 * @description:
 * @author: liu yan
 * @create: 2024-10-21 20:21
 */
public class DataRow {
    private SimpleStringProperty sequenceNumber;
    private SimpleStringProperty wrenchName;
    private SimpleStringProperty barCode;
    private SimpleStringProperty screwID;
    private SimpleStringProperty targetTorque;
    private SimpleStringProperty minTorque;
    private SimpleStringProperty maxTorque;
    private SimpleStringProperty value;
    private SimpleStringProperty outcomeCol;
    private SimpleStringProperty date;

    private SimpleStringProperty time;
    private SimpleIntegerProperty ordinalNumber;



    public String getBarCode() {
        return barCode.get();
    }

    public SimpleStringProperty barCodeProperty() {
        return barCode;
    }

    public String getScrewID() {
        return screwID.get();
    }

    public SimpleStringProperty screwIDProperty() {
        return screwID;
    }

    public String getTargetTorque() {
        return targetTorque.get();
    }

    public SimpleStringProperty targetTorqueProperty() {
        return targetTorque;
    }

    public String getMinTorque() {
        return minTorque.get();
    }

    public SimpleStringProperty minTorqueProperty() {
        return minTorque;
    }

    public String getMaxTorque() {
        return maxTorque.get();
    }

    public SimpleStringProperty maxTorqueProperty() {
        return maxTorque;
    }

    public String getOutcomeCol() {
        return outcomeCol.get();
    }

    public SimpleStringProperty outcomeColProperty() {
        return outcomeCol;
    }

    public DataRow(String sequenceNumber, String wrenchName,  String value, String timestamp, int ordinalNumber) {
        this.sequenceNumber = new SimpleStringProperty(sequenceNumber);
        this.wrenchName = new SimpleStringProperty(wrenchName);
        this.value = new SimpleStringProperty(value);
//        this.timestamp = new SimpleStringProperty(timestamp);
        this.ordinalNumber = new SimpleIntegerProperty(ordinalNumber);
    }

    public DataRow(String sequenceNumber, String wrenchName, String barCode, String screwID, String targetTorque, String minTorque, String maxTorque, String value, String outcomeCol, String date,String time, Integer ordinalNumber) {
        this.sequenceNumber = new SimpleStringProperty(sequenceNumber);
        this.wrenchName = new SimpleStringProperty(wrenchName);
        this.barCode = new SimpleStringProperty(barCode);
        this.screwID = new SimpleStringProperty(screwID);
        this.targetTorque = new SimpleStringProperty(targetTorque);
        this.minTorque = new SimpleStringProperty(minTorque);
        this.maxTorque = new SimpleStringProperty(maxTorque);
        this.value = new SimpleStringProperty(value);
        this.outcomeCol = new SimpleStringProperty(outcomeCol);
        this.date = new SimpleStringProperty(date);
        this.time = new SimpleStringProperty(time);
        this.ordinalNumber = new SimpleIntegerProperty(ordinalNumber);
    }

    @Override
    public String toString() {
        return "{" +
                "\"sequenceNumber\":" + "\""+sequenceNumber.get()+"\"" +
                ",\"wrenchName\":" + "\""+wrenchName.get() +"\""+
                ",\"barCode\":" + "\""+barCode.get() +"\""+
                ",\"screwID\":" + "\""+screwID.get() +"\""+
                ",\"targetTorque\":" + "\""+targetTorque.get() +"\""+
                ",\"minTorque\":" + "\""+minTorque.get() +"\""+
                ",\"maxTorque\":" + "\""+maxTorque.get() +"\""+
                ",\"value\":" + "\""+value.get() +"\""+
                ",\"outcomeCol\":" + "\""+outcomeCol.get() +"\""+
                ", \"date\":" + "\""+date.get() +"\""+
                ", \"time\":" + "\""+time.get() +"\""+
                ", \"ordinalNumber\":" + "\""+ordinalNumber.get() +"\""+
                "}";
    }

    // Getter 方法
    public String getSequenceNumber() {
        return sequenceNumber.get();
    }

    public SimpleStringProperty sequenceNumberProperty() {
        return sequenceNumber;
    }

    public String getWrenchName() {
        return wrenchName.get();
    }

    public SimpleStringProperty wrenchNameProperty() {
        return wrenchName;
    }

    public String getValue() {
        return value.get();
    }

    public SimpleStringProperty valueProperty() {
        return value;
    }

    public String getDate() {
        return date.get();
    }

    public SimpleStringProperty dateProperty() {
        return date;
    }

    public void setDate(String date) {
        this.date.set(date);
    }

    public String getTime() {
        return time.get();
    }

    public SimpleStringProperty timeProperty() {
        return time;
    }

    public void setTime(String time) {
        this.time.set(time);
    }

    public Integer getOrdinalNumber() {
        return ordinalNumber.get();
    }

    public SimpleIntegerProperty ordinalNumberProperty() {
        return ordinalNumber;
    }
}
